package com.ptma.controllers;

import java.util.Locale;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

@Controller
public class LoginController extends AbstractController {

	@RequestMapping(value = "/submit_login", method = RequestMethod.POST)
	public String home(Locale locale, Model model, HttpServletRequest request) {

		model.addAttribute("pageTitle", getProperty("ptma.string"));

		return "index";
	}

	@RequestMapping(value = "/login.html", method = RequestMethod.GET)
	public ModelAndView processLogin(Model model) {

		model.addAttribute("pageTitle", getProperty("login.page.title"));

		model.addAttribute("appName", getProperty("app.name.camelcase"));

		return new ModelAndView("login");
	}

}
